{% extends 'base_with_top_menu.html' %}

{% block title %}Edit config option{% endblock %}

{% block header %}Edit {%if is_global%}global {%endif%}config option{% endblock %}

{% block content %}

{% if form %}
<div class="formWrapper">
  <form class="edit_option_form" action="." method="POST">
    <table class="basic_fields">
      <tbody>
        {% if form.non_field_errors %}
        <tr><td>{{form.non_field_errors}}</td></tr>
        {% endif %}
        <tr><td class="key"><span class="label">Key:</span> {{form.option_key}} </td> </tr>
        {% if is_global %}
        <tr><td class="description"><span class="label">Description:</span> <br/>{{form.description}} {{form.description.errors}}</td> </tr>
        <tr><td class="can_override"><label for="id_can_override"><span class="label">Can override:</span></label> {{form.can_override}}</td> </tr>
        <tr><td class="global_value"><span class="label">Global value:</span> <br/>{{ form.value.errors }} {{ form.value }} </td></tr>
        {% else %}
        <tr><td class="description"><span class="label">Description:</span> {{option.description|linebreaksbr}} </td> </tr>
        <tr><td class="can_override"><span class="label">Can override:</span> {{option.can_override}} </td> </tr>
        <tr><td class="value"><span class="label">Value:</span> <br/>{{ form.value.errors }} {{ form.value }} </td></tr>
        {% endif %}
        <tr> <th></th> <td><input type="submit" value="Save changes"/></td> </tr>
      </tbody>
    </table>
  </form>
</div>

{% endif %}

{% endblock %}
